﻿package commands 
{
	/**
	 * ...
	 * @author Rami
	 */
	
	import as3.collections.IMap;
	import commands.request.IRequestable;
	
	public class SearchProductCommand implements ICommand , IRequestable
	{
		public static const  PRODUCT_NAME_START_ARGUMENT:String = "PRODUCT_NAME_START_ARGUMENT";
		public static const  SEARCH_COMMAND:String = "SEARCH_COMMAND";
		private var commandXml:XML;
		
		public function SearchProductCommand() 
		{
			this.commandXml = new XML("<command></command>");
			commandXml.@name = "SearchProduct";
			trace(commandXml.toString());
		}
		
		public function createCommand(argumentsTable :IMap):String
		{
			var productNameStart:String = argumentsTable.getItem(PRODUCT_NAME_START_ARGUMENT);
			commandXml.productNameStarts = productNameStart;
			return commandXml.toString();
		}
		
		public function execute(command:XML):void
		{
			trace("Command Executor");
			trace("Starts With : " + command.productNameStarts);
		}

	}

}